﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BioBooking.Data;


using System.ComponentModel;

namespace BioBooking.Client.Screens
{
    /// <summary>
    /// Interaction logic for SearchMovie.xaml
    /// </summary>
    public partial class SearchMovie : UserControl
    {
        BioBooking.Data.IRepository repository;

        public SearchMovie()
        {
            InitializeComponent();

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                repository = Repository.GetRepository();
            }
        }

        private void listAllMovies1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Movie mov = listAllMovies1.lbTodaysMovies.SelectedValue as Movie;
            
            if (mov == null)
            {
                return;
            }

            lbTimeSlots.DataContext = mov.Showings;

            this.DataContext = mov;
        }
    }
}
